Disable ServerTelemetryManager by default#8600
Open
tnorling wants to merge 7 commits into
Open
Conversation
added 2 commits
May 21, 2026 13:27
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates MSAL Browser to support disabling MSER server telemetry by default via a new system.serverTelemetryEnabled configuration flag (default false), and wires that flag through the interaction clients, docs, and tests.
Changes:
- Adds
serverTelemetryEnabledtoBrowserSystemOptionswith a default offalse, and updates interaction clients to pass the flag when initializing server telemetry. - Introduces a stub telemetry manager and wraps telemetry cache writes to avoid breaking auth flows if telemetry caching fails.
- Updates documentation, API review files, changefiles, and unit tests to reflect/verify the new default behavior.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/msal-common/src/telemetry/server/ServerTelemetryManager.ts | Wraps cacheFailedRequest in try/catch and adds StubServerTelemetryManager. |
| lib/msal-common/src/exports-common.ts | Exports StubServerTelemetryManager from the msal-common entrypoint. |
| lib/msal-common/apiReview/msal-common.api.md | Updates API review output to include the stub telemetry manager (and a new warning). |
| lib/msal-browser/src/interaction_client/BaseInteractionClient.ts | Adds enabled parameter to initializeServerTelemetryManager and returns stub when disabled. |
| lib/msal-browser/src/interaction_client/PopupClient.ts | Passes serverTelemetryEnabled into telemetry manager initialization. |
| lib/msal-browser/src/interaction_client/RedirectClient.ts | Passes serverTelemetryEnabled into telemetry manager initialization. |
| lib/msal-browser/src/interaction_client/SilentAuthCodeClient.ts | Passes serverTelemetryEnabled into telemetry manager initialization. |
| lib/msal-browser/src/interaction_client/SilentCacheClient.ts | Passes serverTelemetryEnabled into telemetry manager initialization. |
| lib/msal-browser/src/interaction_client/SilentIframeClient.ts | Passes serverTelemetryEnabled into telemetry manager initialization. |
| lib/msal-browser/src/interaction_client/SilentRefreshClient.ts | Passes serverTelemetryEnabled into telemetry manager initialization. |
| lib/msal-browser/src/interaction_client/PlatformAuthInteractionClient.ts | Passes serverTelemetryEnabled into telemetry manager initialization. |
| lib/msal-browser/src/config/Configuration.ts | Adds serverTelemetryEnabled to BrowserSystemOptions and sets default to false. |
| lib/msal-browser/docs/configuration.md | Documents the new serverTelemetryEnabled option and updates sample config. |
| lib/msal-browser/apiReview/msal-browser.api.md | Updates API review to include serverTelemetryEnabled in BrowserSystemOptions. |
| lib/msal-browser/test/config/Configuration.spec.ts | Adds unit tests verifying serverTelemetryEnabled default and explicit true value. |
| lib/msal-browser/test/app/PublicClientApplication.spec.ts | Updates tests to enable server telemetry when asserting cache writes. |
| lib/msal-browser/test/interaction_client/PopupClient.spec.ts | Updates tests to enable server telemetry when asserting cache writes. |
| lib/msal-browser/test/interaction_client/RedirectClient.spec.ts | Updates tests to enable server telemetry when asserting cache writes. |
| lib/msal-browser/test/interaction_client/SilentIframeClient.spec.ts | Updates tests to enable server telemetry when asserting cache writes. |
| lib/msal-browser/test/interaction_client/PlatformAuthInteractionClient.spec.ts | Updates tests to enable server telemetry when asserting cache writes. |
| change/@azure-msal-common-ac7e7225-f5ff-4376-a86b-b6989215c195.json | Adds changefile for msal-common. |
| change/@azure-msal-browser-0c5b4f43-6dec-40eb-8a4d-60a63666c744.json | Adds changefile for msal-browser. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new configuration option,
serverTelemetryEnabled, to the MSAL Browser library, allowing developers to enable or disable server telemetry headers and caching of failed requests. The option is added with a default value offalseand is marked as deprecated for future removal. The PR updates the configuration logic, documentation, and all interaction clients to respect this flag, and adds tests to verify correct behavior.Configuration and API changes:
Added the
serverTelemetryEnabledoption toBrowserSystemOptionsin both the API and implementation, with a default value offalseand marked as deprecated for future removal. This controls whether MSER server telemetry headers are sent and failed requests are cached. [1] [2] [3]Updated the documentation (
configuration.md) to describe the newserverTelemetryEnabledoption, its default value, and its effect. Also updated example configuration usage. [1] [2]Code updates for telemetry behavior:
initializeServerTelemetryManagerfunction to accept anenabledparameter, defaulting totrue, and return a stub manager when telemetry is disabled. Updated all interaction clients (PopupClient,RedirectClient,SilentAuthCodeClient,SilentCacheClient,SilentIframeClient,SilentRefreshClient,PlatformAuthInteractionClient) to pass the new flag from configuration. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18]Testing and validation:
serverTelemetryEnabled, its behavior when set totrue, and that telemetry data is written to storage only when enabled. [1] [2] [3] [4]API review and type updates:
Configuration changes:
serverTelemetryEnabled(defaultfalse, deprecated) toBrowserSystemOptionsand configuration builder, controlling whether server telemetry headers are sent and failed requests are cached. [1] [2] [3]serverTelemetryEnabled. [1] [2]Telemetry manager updates:
initializeServerTelemetryManagerto support disabling telemetry, returning a stub manager when disabled; all interaction clients now respect this configuration flag. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18]Testing:
serverTelemetryEnabled, and that telemetry is written to storage only when enabled. [1] [2] [3] [4]API review: